/*
 * @Author: your name
 * @Date: 2022-06-29 13:28:28
 * @LastEditors: golddream
 * @LastEditTime: 2022-08-04 19:50:51
 * @FilePath: /gua-dev-starter/src/router/index.ts
 * @Description:
 * Copyright (c) 2022 by Oscar Young daihl@neusoft.com, All Rights Reserved.
 */
import { createRouter, createWebHistory } from 'vue-router'
import generatedRoutes from 'virtual:generated-pages'
import { setupLayouts } from 'virtual:generated-layouts'

const generatedRoutesLayout = setupLayouts(generatedRoutes)

export const routes = [...generatedRoutesLayout]
const router = createRouter({
  history: createWebHistory(import.meta.env.VITE_BASE_URL),
  routes,
})

export async function setupRouter(app: any) {
  app.use(router)
}
export default router
